//
//  TransitionBoot.swift
//  SwiftUIWidgetDemo
//
//  Created by alanzhangg on 2023/7/14.
//

import SwiftUI

struct TransitionBoot: View {
    
    @State var showView: Bool = false
    
    var body: some View {
        ZStack(alignment: .bottom){
            
            VStack{
                Button("Button") {
                    
                    withAnimation {
                        showView.toggle()
                    }
                }
                
                Spacer()
            }
            if showView{
                RoundedRectangle(cornerRadius: 30)
                    .frame(height: UIScreen.main.bounds.height * 0.5)
                    .transition(.asymmetric(insertion: .move(edge: .bottom), removal: .move(edge: .leading)))
//                    .transition(.slide.animation(.easeIn))
            }
            
            
        }
        .ignoresSafeArea(edges: .bottom)
    }
}

#Preview {
    TransitionBoot()
}
